#include "ConstBufferSequence.h"

ConstBufferSequence::ConstBufferSequence(void) : 
	m_array_buffer(new std::vector<const ArrayBuffer*>)
{
}

ConstBufferSequence::~ConstBufferSequence(void)
{
	clear();
}


void ConstBufferSequence::clear()
{
	for (size_t i=0; i<m_array_buffer->size(); ++i)
	{
		delete (*m_array_buffer)[i];
	}

	m_array_buffer->clear();
	m_const_buffers.clear();
}


void ConstBufferSequence::pushData(const ArrayBuffer* buffer)
{
	m_const_buffers.push_back(boost::asio::const_buffer(buffer->data(),buffer->size()));
	m_array_buffer->push_back( buffer );
}
